1. Field of the Invention
The present invention relates to a processing apparatus and method in which an element contained in a message received via a network is processed by an application.
2. Description of the Related Art
A so-called “Web service” through which a plurality of apparatuses connected to a network communicates data with one another is presently in practical use. With the Web service, applications running on a plurality of apparatuses exchange objects utilized by the applications. An apparatus on the transmitting side converts an object, which is transmitted by the application on this side, to an XML element and transmits the XML element as part of a SOAP message, which is the standard protocol of the Web service. An apparatus on the receiving side converts the XML element, which has been extracted from the received SOAP message, to an object and the application on the receiving side utilizes this object. An application running on an apparatus on the service-utilizing side transmits an object, which will be the argument of a function in an application on the service-providing side, and receives an object of a return value of the function. Further, the application of the apparatus on the service-providing side executes its own function with the received object serving as an argument and transmits an object of this return value as a response. In data communication utilizing the Web service, a method of thus exchanging objects in the form of a function call is common.
In order to perform the above-mentioned function call, it is required that the XML element received as the SOAP message be converted to an object in a form capable of being utilized by an application. With regard to the conversion, the general practice is for all XML elements contained in the SOAP message to be converted to objects after they are written to a memory, as described in US laid-open patent US2006/0123047. An overview of this method will be described with reference to FIG. 1A. FIGS. 1A-1C are diagrams for comparing methods of processing a received SOAP message. A SOAP message 101 contains a plurality of XML elements 107. A communication apparatus 102 that has received the SOAP message 101 writes all of the XML elements 107 contained in the SOAP message 101 to a memory 105 and a converter 103 converts the elements to objects 108. In FIGS. 1A-1C, E1 to En represent XML elements and O1 to On represent objects in which respective ones of these XML elements have been converted. An application 104 executes processing using the objects 108.
It is possible for the format of a SOAP message to be defined beforehand by an interface definition document, etc. However, there are many cases where the number of XML elements is first defined when a function is implemented, and an apparatus on the side that receives the SOAP message cannot predict the size of the SOAP message in advance. In a case where a SOAP message having a large number of XML elements is converted to objects all at one time, memory is put under pressure particularly in an environment in which memory capacity is small, as in the case of a built-in apparatus. As a result, there is a possibility that XML elements contained in the SOAP message cannot be converted to objects or that even if elements can be converted, execution of an application cannot continue owing to inadequate memory. For example, with the format shown in FIG. 1A, all XML elements 107 contained in the SOAP message 101 are converted to objects 108 after they are written to memory 105. As a consequence, the memory 105 is put under pressure when the number of XML elements 107 is large.
It is possible for an application to process XML elements without converting them to objects. For example, there is format shown in FIG. 1B. Here an application that has received the SOAP message 101 extracts the XML elements 107 and converts them to the objects 108. Since it is possible for the application 104 to save an object 109, which is not used immediately, in a temporary storage area 106, there is no fear that the memory will be put under pressure unnecessarily. In this case, however, processing for handling SOAP messages directly and processing for converting XML elements to objects capable of being processed by the application must be implemented by respective applications. This results in a marked decline in the efficiency with which applications can be developed.